<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>心之所向：我们的爱情故事</title>
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&family=Ma+Shan+Zheng&family=ZCOOL+XiaoWei&display=swap');

        :root {
            --primary-color: #e74c3c;
            --secondary-color: #3498db;
            --accent-color: #f1c40f;
            --text-color: #2c3e50;
            --background-color: #ecf0f1;
            --white: #ffffff;
            --black: #000000;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Noto Serif SC', serif;
            line-height: 1.8;
            color: var(--text-color);
            background-color: var(--background-color);
            overflow-x: hidden;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* Header Styles */
        header {
            position: fixed;
            width: 100%;
            top: 0;
            left: 0;
            z-index: 1000;
            transition: all 0.5s ease;
        }

        header.scrolled {
            background-color: rgba(255, 255, 255, 0.95);
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
        }

        nav {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 5%;
        }

        .logo {
            font-family: 'Ma Shan Zheng', cursive;
            font-size: 2rem;
            color: var(--primary-color);
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .logo:hover {
            transform: scale(1.05);
            text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
        }

        .nav-links {
            display: flex;
            list-style: none;
        }

        .nav-links li {
            margin-left: 2rem;
        }

        .nav-links a {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 500;
            transition: all 0.3s ease;
            position: relative;
        }

        .nav-links a::after {
            content: '';
            position: absolute;
            width: 0;
            height: 2px;
            bottom: -5px;
            left: 0;
            background-color: var(--primary-color);
            transition: all 0.3s ease;
        }

        .nav-links a:hover::after {
            width: 100%;
        }

        /* Hero Section Styles */
        .hero {
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('static/1 (1).png') no-repeat center center;
            background-size: cover;
            color: var(--white);
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1;
        }

        .hero-content {
            max-width: 800px;
            padding: 2rem;
            position: relative;
            z-index: 2;
        }

        .hero h1 {
            font-size: 4rem;
            margin-bottom: 1rem;
            font-family: 'ZCOOL XiaoWei', serif;
            animation: fadeInUp 1s ease-out;
        }

        .hero p {
            font-size: 1.2rem;
            margin-bottom: 2rem;
            animation: fadeInUp 1s ease-out 0.5s both;
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .btn {
            display: inline-block;
            padding: 1rem 2rem;
            background-color: var(--primary-color);
            color: var(--white);
            text-decoration: none;
            border-radius: 50px;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            z-index: 1;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 0;
            height: 100%;
            background-color: var(--secondary-color);
            transition: all 0.3s ease;
            z-index: -1;
        }

        .btn:hover::before {
            width: 100%;
        }

        .btn:hover {
            color: var(--white);
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }

        /* Story Section Styles */
        .story-section {
            padding: 5rem 0;
            background-color: var(--white);
        }

        .story-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 2rem;
        }

        .story-item {
            background-color: var(--background-color);
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
            transition: all 0.3s ease;
        }

        .story-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        }

        .story-image {
            width: 100%;
            height: 200px;
            object-fit: cover;
        }

        .story-content {
            padding: 1.5rem;
        }

        .story-title {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: var(--primary-color);
        }

        /* Gallery Section Styles */
        .gallery-section {
            padding: 5rem 0;
            background-color: var(--background-color);
        }

        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
        }

        .gallery-item {
            position: relative;
            overflow: hidden;
            border-radius: 10px;
            cursor: pointer;
        }

        .gallery-item img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: all 0.3s ease;
        }

        .gallery-item:hover img {
            transform: scale(1.1);
        }

        .gallery-caption {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: rgba(0, 0, 0, 0.7);
            color: var(--white);
            padding: 1rem;
            transform: translateY(100%);
            transition: all 0.3s ease;
        }

        .gallery-item:hover .gallery-caption {
            transform: translateY(0);
        }

        /* Video Section Styles */
        .video-section {
            padding: 5rem 0;
            background-color: var(--white);
        }

        .video-container {
            position: relative;
            width: 100%;
            padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
        }

        .video-container video {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        /* Timeline Section Styles */
        .timeline-section {
            padding: 5rem 0;
            background-color: var(--background-color);
            position: relative;
        }

        .timeline {
            position: relative;
            max-width: 1200px;
            margin: 0 auto;
        }

        .timeline::after {
            content: '';
            position: absolute;
            width: 6px;
            background-color: var(--primary-color);
            top: 0;
            bottom: 0;
            left: 50%;
            margin-left: -3px;
        }

        .timeline-item {
            padding: 10px 40px;
            position: relative;
            background-color: inherit;
            width: 50%;
        }

        .timeline-item::after {
            content: '';
            position: absolute;
            width: 25px;
            height: 25px;
            right: -17px;
            background-color: var(--white);
            border: 4px solid var(--primary-color);
            top: 15px;
            border-radius: 50%;
            z-index: 1;
        }

        .left {
            left: 0;
        }

        .right {
            left: 50%;
        }

        .right::after {
            left: -16px;
        }

        .timeline-content {
            padding: 20px 30px;
            background-color: var(--white);
            position: relative;
            border-radius: 6px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        /* Poem Section Styles */
        .poem-section {
            padding: 5rem 0;
            background-color: var(--white);
            text-align: center;
        }

        .poem {
            max-width: 800px;
            margin: 0 auto;
            font-style: italic;
            line-height: 2;
        }

        .poem p {
            margin-bottom: 1rem;
        }

        /* Letter Section Styles */
        .letter-section {
            padding: 5rem 0;
            background-color: var(--background-color);
        }

        .letter {
            max-width: 800px;
            margin: 0 auto;
            background-color: var(--white);
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            position: relative;
        }

        .letter::before {
            content: '';
            position: absolute;
            top: -10px;
            left: 20px;
            width: 0;
            height: 0;
            border-left: 15px solid transparent;
            border-right: 15px solid transparent;
            border-bottom: 15px solid var(--white);
        }

        .signature {
            text-align: right;
            font-style: italic;
            margin-top: 2rem;
        }

        /* Footer Styles */
        footer {
            background-color: var(--text-color);
            color: var(--white);
            text-align: center;
            padding: 3rem 0;
        }

        .footer-content {
            max-width: 800px;
            margin: 0 auto;
        }

        .social-icons {
            margin-top: 2rem;
        }

        .social-icons a {
            color: var(--white);
            font-size: 1.5rem;
            margin: 0 10px;
            transition: all 0.3s ease;
        }

        .social-icons a:hover {
            color: var(--primary-color);
            transform: translateY(-3px);
        }

        /* Lightbox Styles */
        .lightbox {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s ease;
        }

        .lightbox.active {
            opacity: 1;
            pointer-events: auto;
        }

        .lightbox-content {
            max-width: 90%;
            max-height: 90%;
        }

        .lightbox-content img {
            width: 100%;
            height: auto;
        }

        .lightbox-close {
            position: absolute;
            top: 20px;
            right: 20px;
            font-size: 2rem;
            color: var(--white);
            cursor: pointer;
        }

        /* Music Player Styles */
        .music-player {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background-color: rgba(255, 255, 255, 0.9);
            padding: 10px;
            border-radius: 50px;
            display: flex;
            align-items: center;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            z-index: 100;
        }

        .music-player button {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--primary-color);
            cursor: pointer;
            margin-right: 10px;
        }

        .music-player .song-info {
            font-size: 0.9rem;
        }

        /* Responsive Styles */
        @media screen and (max-width: 768px) {
            .hero h1 {
                font-size: 3rem;}

            .hero p {
                font-size: 1rem;
            }

            .timeline::after {
                left: 31px;
            }

            .timeline-item {
                width: 100%;
                padding-left: 70px;
                padding-right: 25px;
            }

            .timeline-item::before {
                left: 60px;
                border: medium solid var(--primary-color);
                border-width: 10px 10px 10px 0;
                border-color: transparent var(--primary-color) transparent transparent;
            }

            .left::after, .right::after {
                left: 15px;
            }

            .right {
                left: 0%;
            }
        }

        /* Animation Styles */
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes slideInLeft {
            from { transform: translateX(-100%); }
            to { transform: translateX(0); }
        }

        @keyframes slideInRight {
            from { transform: translateX(100%); }
            to { transform: translateX(0); }
        }

        @keyframes zoomIn {
            from { transform: scale(0); }
            to { transform: scale(1); }
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-30px); }
            60% { transform: translateY(-15px); }
        }

        .fade-in { animation: fadeIn 1s ease-out; }
        .slide-in-left { animation: slideInLeft 1s ease-out; }
        .slide-in-right { animation: slideInRight 1s ease-out; }
        .zoom-in { animation: zoomIn 1s ease-out; }
        .bounce { animation: bounce 2s infinite; }

        /* Parallax Effect */
        .parallax {
            background-attachment: fixed;
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
        }

        /* Scroll Reveal */
        .reveal {
            position: relative;
            opacity: 0;
            transition: all 1s ease-in-out;
        }

        .reveal.active {
            opacity: 1;
        }

        .reveal.fade-bottom { transform: translateY(50px); }
        .reveal.fade-left { transform: translateX(-50px); }
        .reveal.fade-right { transform: translateX(50px); }

        .reveal.active.fade-bottom,
        .reveal.active.fade-left,
        .reveal.active.fade-right {
            transform: translateY(0);
            transform: translateX(0);
        }

        /* Floating Hearts */
        .heart {
            position: fixed;
            top: -1vh;
            font-size: 2rem;
            color: var(--primary-color);
            pointer-events: none;
            animation: fall 3s linear forwards;
        }

        @keyframes fall {
            to {
                transform: translateY(105vh) rotate(360deg);
            }
        }

        /* Cursor Effect */
        .custom-cursor {
            width: 20px;
            height: 20px;
            border: 2px solid var(--primary-color);
            border-radius: 50%;
            position: fixed;
            pointer-events: none;
            z-index: 9999;
            transition: all 0.1s ease;
            transform: translate(-50%, -50%);
        }

        .cursor-dot {
            width: 5px;
            height: 5px;
            background-color: var(--primary-color);
            border-radius: 50%;
            position: fixed;
            pointer-events: none;
            z-index: 9999;
            transition: all 0.15s ease-out;
            transform: translate(-50%, -50%);
        }
    </style>
</head>
<body>
<div class="custom-cursor"></div>
<div class="cursor-dot"></div>

<header>
    <nav>
        <a href="#" class="logo">心之所向</a>
        <ul class="nav-links">
            <li><a href="#home">首页</a></li>
            <li><a href="#story">我们的故事</a></li>
            <li><a href="#gallery">珍贵回忆</a></li>
            <li><a href="#video">浪漫时刻</a></li>
            <li><a href="#timeline">时光轴</a></li>
            <li><a href="#letter">真挚告白</a></li>
        </ul>
    </nav>
</header>

<section id="home" class="hero parallax">
    <div class="hero-content">
        <h1 class="fade-in">心之所向，情之所归</h1>
        <p class="fade-in">在这浩瀚宇宙中，能与你相遇，是我生命中最璀璨的星河。</p>
        <a href="#story" class="btn bounce">开启我们的故事</a>
    </div>
</section>

<section id="story" class="story-section">
    <div class="container">
        <h2 class="section-title reveal fade-bottom">我们的故事</h2>
        <div class="story-grid">
            <div class="story-item reveal fade-left">
                <img src="static/1 (2).png" alt="初次相遇" class="story-image">
                <div class="story-content">
                    <h3 class="story-title">初次相遇</h3>
                    <p>那天，阳光温柔，你的笑容如春风拂面，瞬间点亮了我的世界。</p>
                </div>
            </div>
            <div class="story-item reveal fade-right">
                <img src="static/1 (3).png" alt="甜蜜时光" class="story-image">
                <div class="story-content">
                    <h3 class="story-title">甜蜜时光</h3>
                    <p>每一个与你共度的瞬间，都是上天赐予的珍贵礼物。</p>
                </div>
            </div>
            <div class="story-item reveal fade-left">
                <img src="static/1 (4).png" alt="浪漫旅行" class="story-image">
                <div class="story-content">
                    <h3 class="story-title">浪漫旅行</h3>
                    <p>在陌生的城市，我们携手探索，你是我最美的风景。</p>
                </div>
            </div>
        </div>
    </div>
</section>

<section id="gallery" class="gallery-section parallax">
    <div class="container">
        <h2 class="section-title reveal fade-bottom">珍贵回忆</h2>
        <div class="gallery-grid">
            <div class="gallery-item reveal fade-left">
                <img src="static/1 (5).png" alt="幸福时刻">
                <div class="gallery-caption">幸福时刻</div>
            </div>
            <div class="gallery-item reveal fade-right">
                <img src="static/1 (6).png" alt="甜蜜约会">
                <div class="gallery-caption">甜蜜约会</div>
            </div>
            <div class="gallery-item reveal fade-left">
                <img src="static/1 (7).png" alt="浪漫晚餐">
                <div class="gallery-caption">浪漫晚餐</div>
            </div>
            <div class="gallery-item reveal fade-right">
                <img src="static/1 (8).png" alt="美好回忆">
                <div class="gallery-caption">美好回忆</div>
            </div>
            <div class="gallery-item reveal fade-left">
                <img src="static/1 (9).png" alt="幸福瞬间">
                <div class="gallery-caption">幸福瞬间</div>
            </div>
            <div class="gallery-item reveal fade-right">
                <img src="static/1 (10).png" alt="温馨时光">
                <div class="gallery-caption">温馨时光</div>
            </div>
        </div>
    </div>
</section>

<section id="video" class="video-section">
    <div class="container">
        <h2 class="section-title reveal fade-bottom">浪漫时刻</h2>
        <div class="video-container reveal zoom-in">
            <video controls>
                <source src="static/1.mp4" type="video/mp4">
                Your browser does not support the video tag.
            </video>
        </div>
    </div>
</section>

<section id="timeline" class="timeline-section">
    <div class="container">
        <h2 class="section-title reveal fade-bottom">我们的时光轴</h2>
        <div class="timeline">
            <div class="timeline-item left reveal fade-right">
                <div class="timeline-content">
                    <h3>初次相遇</h3>
                    <p>那天，我们的目光在图书馆相遇，世界仿佛停止了转动。</p>
                </div>
            </div>
            <div class="timeline-item right reveal fade-left">
                <div class="timeline-content">
                    <h3>甜蜜告白</h3>
                    <p>在樱花盛开的季节，我鼓起勇气向你表白，你的笑容是最美的回应。</p>
                </div>
            </div>
            <div class="timeline-item left reveal fade-right">
                <div class="timeline-content">
                    <h3>浪漫旅行</h3>
                    <p>我们的第一次旅行，在异国他乡感受爱情的美好。</p>
                </div>
            </div>
            <div class="timeline-item right reveal fade-left">
                <div class="timeline-content">
                    <h3>共度难关</h3>
                    <p>在人生的低谷，我们携手共渡难关，爱情更加坚固。</p>
                </div>
            </div>
            <div class="timeline-item left reveal fade-right">
                <div class="timeline-content">
                    <h3>美好未来</h3>
                    <p>展望未来，我们憧憬着美好的生活，期待每一个共度的日子。</p>
                </div>
            </div>
        </div>
    </div>
</section>

<section class="poem-section parallax">
    <div class="container">
        <h2 class="section-title reveal fade-bottom">爱的诗篇</h2>
        <div class="poem reveal fade-in">
            <p>你是清晨的第一缕阳光，</p>
            <p>温柔地抚摸我的脸庞。</p>
            <p>你是午后的一阵微风，</p>
            <p>轻轻拂过我的心房。</p>
            <p>你是夜晚的一轮明月，</p>
            <p>照亮我生命的航向。</p>
            <p>你是四季变换的风景，</p>
            <p>让我的世界绚丽多彩。</p>
            <p>有你相伴的每一天，</p>
            <p>都是上天赐予的礼物。</p>
            <p>我愿用余生的每一刻，</p>
            <p>珍惜你、爱护你、陪伴你。</p>
        </div>
    </div>
</section>

<section id="letter" class="letter-section">
    <div class="container">
        <h2 class="section-title reveal fade-bottom">真挚告白</h2>
        <div class="letter reveal fade-in">
            <p>亲爱的，</p>
            <p>当我执笔写下这封信时，内心充满了激动和温暖。回首往事，与你相遇的每一个瞬间都历历在目，仿佛发生在昨日。</p>
            <p>还记得我们初次相遇的那个午后吗？阳光温柔地洒在图书馆的书架上，你专注阅读的侧颜让我难以移开视线。那一刻，我就知道，你是我一直在等待的那个人。</p>
            <p>与你在一起的每一天都是一次奇妙的冒险。你的善良温暖了我的心，你的智慧启发了我的思想，你的勇气鼓舞了我的灵魂。你不仅是我的爱人，更是我最好的朋友和人生伴侣。</p>
            <p>在你身边，我找到了归属感。你的臂弯是我最安全的港湾，你的笑容是我最珍贵的宝藏。无论顺境还是逆境，只要有你在身边，我就有勇气面对一切。</p>
            <p>我深深地爱着你，不仅爱你的优点，也包容你的缺点。你的一切都是那么可爱，构成了我心中完美的你。我珍惜我们之间的每一个瞬间，无论是热烈的激情还是平淡的日常。</p>
            <p>今天，我想向全世界宣告我对你的爱。你是我生命中最美好的礼物，是我想共度余生的人。我承诺会一如既往地爱你、尊重你、支持你，与你携手共创美好的未来。</p>
            <p>感谢你出现在我的生命中，让我的世界变得如此美好。我爱你，现在和永远。</p>
            <p class="signature">永远爱你的我</p>
        </div>
    </div>
</section>

<footer>
    <div class="footer-content">
        <h3>永远爱你</h3><p>无论晴天雨天，我都愿意与你一同前行。你是我的挚爱，我的灵魂伴侣。</p>
        <div class="social-icons">
            <a href="#"><i class="fab fa-weixin"></i></a>
            <a href="#"><i class="fab fa-weibo"></i></a>
            <a href="#"><i class="fab fa-instagram"></i></a>
            <a href="#"><i class="fab fa-twitter"></i></a>
        </div>
    </div>
</footer>

<div class="lightbox">
    <span class="lightbox-close">&times;</span>
    <img class="lightbox-content" src="" alt="">
</div>

<div class="music-player">
    <button id="playPauseBtn"><i class="fas fa-play"></i></button>
    <div class="song-info">正在播放：我们的爱情协奏曲</div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/js/all.min.js"></script>
<script>
    // 页面滚动效果
    window.addEventListener('scroll', () => {
        const header = document.querySelector('header');
        header.classList.toggle('scrolled', window.scrollY > 0);

        // 滚动显示动画
        const reveals = document.querySelectorAll('.reveal');
        reveals.forEach(reveal => {
            const windowHeight = window.innerHeight;
            const revealTop = reveal.getBoundingClientRect().top;
            const revealPoint = 150;

            if (revealTop < windowHeight - revealPoint) {
                reveal.classList.add('active');
            } else {
                reveal.classList.remove('active');
            }
        });
    });

    // 平滑滚动
    document.querySelectorAll('a[href^="#"]').forEach(anchor => {
        anchor.addEventListener('click', function (e) {
            e.preventDefault();
            document.querySelector(this.getAttribute('href')).scrollIntoView({
                behavior: 'smooth'
            });
        });
    });

    // 图片画廊和灯箱效果
    const galleryItems = document.querySelectorAll('.gallery-item');
    const lightbox = document.querySelector('.lightbox');
    const lightboxImg = document.querySelector('.lightbox-content');
    const lightboxClose = document.querySelector('.lightbox-close');

    galleryItems.forEach(item => {
        item.addEventListener('click', () => {
            lightbox.classList.add('active');
            lightboxImg.src = item.querySelector('img').src;
        });
    });

    lightboxClose.addEventListener('click', () => {
        lightbox.classList.remove('active');
    });

    // 音乐播放器
    const playPauseBtn = document.getElementById('playPauseBtn');
    const audioElement = new Audio('path/to/your/audio/file.mp3');
    let isPlaying = false;

    playPauseBtn.addEventListener('click', () => {
        if (isPlaying) {
            audioElement.pause();
            playPauseBtn.innerHTML = '<i class="fas fa-play"></i>';
        } else {
            audioElement.play();
            playPauseBtn.innerHTML = '<i class="fas fa-pause"></i>';
        }
        isPlaying = !isPlaying;
    });

    // 创建心形特效
    function createHeart() {
        const heart = document.createElement('div');
        heart.classList.add('heart');
        heart.style.left = Math.random() * 100 + 'vw';
        heart.style.animationDuration = Math.random() * 2 + 3 + 's';
        heart.innerHTML = '♥';
        document.body.appendChild(heart);

        setTimeout(() => {
            heart.remove();
        }, 5000);
    }

    setInterval(createHeart, 300);

    // 自定义光标效果
    const cursor = document.querySelector('.custom-cursor');
    const cursorDot = document.querySelector('.cursor-dot');

    document.addEventListener('mousemove', (e) => {
        cursor.style.left = e.clientX + 'px';
        cursor.style.top = e.clientY + 'px';
        cursorDot.style.left = e.clientX + 'px';
        cursorDot.style.top = e.clientY + 'px';
    });

    document.addEventListener('mousedown', () => {
        cursor.style.transform = 'translate(-50%, -50%) scale(0.8)';
        cursorDot.style.transform = 'translate(-50%, -50%) scale(0.5)';
    });

    document.addEventListener('mouseup', () => {
        cursor.style.transform = 'translate(-50%, -50%) scale(1)';
        cursorDot.style.transform = 'translate(-50%, -50%) scale(1)';
    });

    // 视差滚动效果
    window.addEventListener('scroll', () => {
        const parallaxElements = document.querySelectorAll('.parallax');
        parallaxElements.forEach(element => {
            const scrollPosition = window.pageYOffset;
            element.style.backgroundPositionY = scrollPosition * 0.5 + 'px';
        });
    });

    // 打字机效果
    function typeWriter(element, text, speed) {
        let i = 0;
        function type() {
            if (i < text.length) {
                element.innerHTML += text.charAt(i);
                i++;
                setTimeout(type, speed);
            }
        }
        type();
    }

    // 在适当的时机调用打字机效果
    const heroTitle = document.querySelector('.hero h1');
    typeWriter(heroTitle, "心之所向，情之所归", 100);

    // 3D卡片效果
    const storyItems = document.querySelectorAll('.story-item');
    storyItems.forEach(item => {
        item.addEventListener('mousemove', (e) => {
            const rect = item.getBoundingClientRect();
            const x = e.clientX - rect.left;
            const y = e.clientY - rect.top;

            const centerX = rect.width / 2;
            const centerY = rect.height / 2;

            const deltaX = (x - centerX) / centerX;
            const deltaY = (y - centerY) / centerY;

            item.style.transform = `perspective(1000px) rotateX(${deltaY * 10}deg) rotateY(${-deltaX * 10}deg) scale3d(1.05, 1.05, 1.05)`;
        });

        item.addEventListener('mouseleave', () => {
            item.style.transform = 'perspective(1000px) rotateX(0) rotateY(0) scale3d(1, 1, 1)';
        });
    });

    // 图片懒加载
    const lazyImages = document.querySelectorAll('img[data-src]');
    const loadImage = (image) => {
        image.setAttribute('src', image.getAttribute('data-src'));
        image.onload = () => {
            image.removeAttribute('data-src');
            image.classList.add('loaded');
        };
    };

    const lazyLoadImages = () => {
        const windowHeight = window.innerHeight;
        lazyImages.forEach(img => {
            const rect = img.getBoundingClientRect();
            if (rect.top <= windowHeight && rect.bottom >= 0) {
                loadImage(img);
            }
        });
    };

    window.addEventListener('scroll', lazyLoadImages);
    window.addEventListener('resize', lazyLoadImages);
    window.addEventListener('orientationchange', lazyLoadImages);

    // 初始加载
    lazyLoadImages();

    // 页面加载完成后的动画
    window.addEventListener('load', () => {
        document.body.classList.add('loaded');

        // 添加入场动画
        const animatedElements = document.querySelectorAll('.fade-in, .slide-in-left, .slide-in-right, .zoom-in');
        animatedElements.forEach(element => {
            element.classList.add('animate');
        });
    });

    // 粒子效果
    function createParticles() {
        const particlesContainer = document.createElement('div');
        particlesContainer.className = 'particles-container';
        document.body.appendChild(particlesContainer);

        for (let i = 0; i < 50; i++) {
            const particle = document.createElement('div');
            particle.className = 'particle';
            particle.style.left = Math.random() * 100 + 'vw';
            particle.style.top = Math.random() * 100 + 'vh';
            particle.style.animationDuration = (Math.random() * 2 + 1) + 's';
            particle.style.animationDelay = Math.random() + 's';
            particlesContainer.appendChild(particle);
        }
    }

    createParticles();

    // 视频自动播放/暂停
    const video = document.querySelector('.video-container video');
    const videoObserver = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                video.play();
            } else {
                video.pause();
            }
        });
    }, { threshold: 0.5 });

    videoObserver.observe(video);

    // 时间线动画
    const timelineItems = document.querySelectorAll('.timeline-item');
    const timelineObserver = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                entry.target.classList.add('animate');
            } else {
                entry.target.classList.remove('animate');
            }
        });
    }, { threshold: 0.5 });

    timelineItems.forEach(item => {
        timelineObserver.observe(item);
    });

    // 添加页面过渡效果
    const transitionElement = document.createElement('div');
    transitionElement.className = 'page-transition';
    document.body.appendChild(transitionElement);

    function pageTransition() {
        transitionElement.classList.add('active');
        setTimeout(() => {
            transitionElement.classList.remove('active');
        }, 500);
    }

    // 在页面加载和链接点击时触发过渡效果
    window.addEventListener('load', pageTransition);
    document.querySelectorAll('a').forEach(link => {
        link.addEventListener('click', (e) => {
            e.preventDefault();
            const href = link.getAttribute('href');
            pageTransition();
            setTimeout(() => {
                window.location = href;
            }, 500);
        });
    });

    // 添加页面预加载器
    const preloader = document.createElement('div');
    preloader.className = 'preloader';
    preloader.innerHTML = '<div class="loader"></div>';
    document.body.appendChild(preloader);

    window.addEventListener('load', () => {
        preloader.classList.add('fade-out');
        setTimeout(() => {
            preloader.style.display = 'none';
        }, 1000);
    });
</script>
</body>
</html>